<template>
<div class="app-container">
    <el-row>
        <router-link :to="'/basic/addType/'">
            <el-button type="primary" style="margin-bottom:20px;margin-left:20px" @click="addType">添加分类</el-button>
        </router-link>
    </el-row>
    <el-table v-loading="listLoading" :data="typeList" element-loading-text="Loading" border fit highlight-current-row>
        <el-table-column align="center" label="分类ID" prop="id">
        </el-table-column>
        <el-table-column align="center" label="分类名称" prop="type">
        </el-table-column>

    </el-table>
</div>
</template>

<script>
export default {
    data: function () {
        return {
            typeList: [],
            listLoading: true,
        }
    },
    created() {
        this.getTypeList();
    },
    methods: {
        //获取拍品列表
        getTypeList() {
            this.listLoading = true
            this.axios({
                url: 'http://localhost:8888/goods/goods/goodstype/getTypes',
                method: 'get'

            }).then(res => {
                console.log(res);

                this.typeList = res.data.data.types;
                this.listLoading = false

            })

        },
        addType() {

        },
    }
}
</script>

<style>

</style>
